package com.totowoo.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.totowoo.pojo.BranchSchool;

public interface BranchSchoolDao extends JpaRepository<BranchSchool, Integer> {
	
	public List<BranchSchool> findByNameLike(String name);
	public BranchSchool findByCode(String code);
	
	@Query(value="from BranchSchool where city like :abc")
	public List<BranchSchool> getCitysLike(@Param("abc") String city);
	
	@Query(value="from BranchSchool where city like ?1")
	public List<BranchSchool> getCitys( String city);
	
	@Query(value="update branchschool set city=?1 where id=?2", nativeQuery=true)
	@Modifying
	public void updatBranchSchoolCity(String city, Integer id);

}
